Spread Windows Forms 12.0 Product Documentation
SetCalendarText(String[],String[],String[],String[],String,String) Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > DateTimeCellType Class > SetCalendarText Method : SetCalendarText(String[],String[],String[],String[],String,String) Method
Set of day names
Set of month names
Set of abbreviated day names
Set of abbreviated month names
Text for the OK button
Text for the Cancel button
Sets the various text elements for the pop-up calendar, including the day and month names and the button text.
Syntax
'Declaration
 
Public Overloads Sub SetCalendarText( _
   ByVal dayNames() As String, _
   ByVal monthNames() As String, _
   ByVal shortdayNames() As String, _
   ByVal shortmonthNames() As String, _
   ByVal okText As String, _
   ByVal cancelText As String _
) 
'Usage
 
Dim instance As DateTimeCellType
Dim dayNames() As String
Dim monthNames() As String
Dim shortdayNames() As String
Dim shortmonthNames() As String
Dim okText As String
Dim cancelText As String
 
instance.SetCalendarText(dayNames, monthNames, shortdayNames, shortmonthNames, okText, cancelText)
public void SetCalendarText( 
   string[] dayNames,
   string[] monthNames,
   string[] shortdayNames,
   string[] shortmonthNames,
   string okText,
   string cancelText
)

Parameters

dayNames
Set of day names
monthNames
Set of month names
shortdayNames
Set of abbreviated day names
shortmonthNames
Set of abbreviated month names
okText
Text for the OK button
cancelText
Text for the Cancel button
Remarks

The four string arrays for names set the names for the ddd, dddd, MMM and MMMM formats when used in the DateTimeCellType's editor. If any of the four string arrays for names are null, the Calendar displays using the values set in the DateTimeCellType's properties. If those are null the system names are used.

The two text parameters determine the text that appears in the buttons at the bottom of the calendar control.

Be aware that this method sets the calendar text only for an individual cell, so different cells can have different calendar text within the same Spread component.

For more information on the one-dimensional string array containing the names of the months, refer to MonthNames topic in the Microsoft .NET Framework documentation.

Example
Dim dt As New FarPoint.Win.Spread.CellType.DateTimeCellType()
Dim dNames() As String = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
Dim mNames() As String = {"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec",""}
Dim sdNames() As String = {"SU", "M", "T", "W", "TH", "F", "S"}
Dim smNames() As String = {"J", "F", "M", "A", "MY", "J", "JY", "AG", "S", "O", "N", "D",""}
Dim okbutn As String = "Accept"
Dim canbutn As String = "Decline"
dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined
dt.UserDefinedFormat = "dddd  MMMM d,  yyyy"
dt.SetCalendarText(dNames(),mNames(),sdNames(),smNames(),okbutn, canbutn)
fpSpread1.ActiveSheet.Cells(0, 0).CellType = dt
fpSpread1.ActiveSheet.Cells(0, 0).Value = Now
fpSpread1.ActiveSheet.Columns(0).Width = 130
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType();
string[] dNames = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
string[] mNames = {"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec",""};
string[] sdNames = {"SU", "M", "T", "W", "TH", "F", "S"};
string[] smNames = {"J", "F", "M", "A", "MY", "J", "JY", "AG", "S", "O", "N", "D",""};
string okbutn = "Accept";
string canbutn = "Decline";
dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;
dt.UserDefinedFormat = "dddd  MMMM d,  yyyy";
dt.SetCalendarText(dNames,mNames,sdNames,smNames,okbutn, canbutn);
fpSpread1.ActiveSheet.Cells[0, 0].CellType = dt;
fpSpread1.ActiveSheet.Cells[0, 0].Value = System.DateTime.Now;
fpSpread1.ActiveSheet.Columns[0].Width = 130;
See Also

Reference

DateTimeCellType Class
DateTimeCellType Members
Overload List